package com.bootdo.common.listenner;

import com.bootdo.common.service.JobService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Order(value = 1)
public class ScheduleJobInitListener implements CommandLineRunner {

    @Resource
    private JobService scheduleJobService;

    @Override
    public void run(String... arg0) {
        try {
            scheduleJobService.initSchedule();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}